<div id="form-msg"></div>
<form action="javascript:add_category()" id="add_category" method="post" class="modal hide form-horizontal" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true" onclick="hideModal('add_project');">×</button>
    <h4 id="myModalLabel">Add category</h4>
  </div>
  <div class="modal-body">
	<div id="form-error"></div>
	<div class="form-controls">
		<div class="control-group">
			<label class="control-label-left">Title category</label>
			<div class="controls">
				<input type="text" id="form-add-category-input-title"  name="login">
				<input type="hidden" id="form-input-uuid"  name="uuid">
			</div>
		</div>
	</div>
  </div>
  <div class="modal-footer">
	<input class="btn" type="reset" value="Close" data-dismiss="modal" aria-hidden="true" onclick="hideModal('add_project');">
	<input class="btn btn-primary" type="submit" value="Save">
  </div>
</form>
<div class="row">
	<div class="span12">
		<div class="bookmark-title">
			<h4>Categories</h4>
			<hr>
		</div>
	</div>
	<form action="<?=$currentUrl;?>" method="POST" name="category_list">
		<input type="hidden" name="filter_<?php echo $fltInfo['__name__']; ?>" value="on"/>
		<div class="span5">
			<div class="btn-group">
				<label for="btn_deactivate"	class="btn btn-small">Deactivate</label>
				<label for="btn_activate"	class="btn btn-small">Activate</label>	
				<label for="btn_delete"		class="btn btn-small">Delete</label>
			</div>
			<input id="btn_deactivate"	class="hide" type="submit" name="act" value="Deactivate"	onclick="return isCheck();">
			<input id="btn_activate"	class="hide" type="submit" name="act" value="Activate"		onclick="return isCheck();">
			<input id="btn_delete"		class="hide" type="submit" name="act" value="Delete"		onclick="return isCheck(1);">
			
			<div class="btn-group">
				<a id="btn_add_category" href="javascript:void(0)" role="button" class="btn btn-small btn-primary" data-toggle="modal"><i class="icon-plus icon-white"></i>&nbsp; Add category</a>
			</div>
		</div>
		<div class="span4 pagination pagination-small">
			<?php include('tpl/bootstrap_pager.php')?>
		</div>
		<div class="span3 button-filter text-right">
			<label for="btn_reset_filter" class="btn btn-small">Reset Filter</label>
			<label for="btn_filter" class="btn btn-small">Filter</label>
			<input id="btn_reset_filter" class="hide" type="submit" name="filter_reset" value="Reset Filter">
			<input id="btn_filter" class="hide" type="submit" name="filter_set"   value="Filter">
		</div>
		<div class="span12">
			<table class="table table-bordered table-condensed table-hover">
				<col style="width:25px;">
				<col>
				<col style="width:100px;">
				<col style="width:95px;">
				<thead>
					<tr class="tr-sorter">
						<th>&nbsp;</th>
						<?php Sorter::show($srtInfo['title'],'Title')?>
						<?php Sorter::show($srtInfo['status'],'Status')?>
						<th class="text-center">Action</th>
					</tr>
				</thead>
				<tr class="info table-filter-tr">
					<td><input name="all" type="checkbox" onclick="selectAll('uuid[]', this.checked,'category_list')"></td>
					<td><input  class="span2" type="text" name="flt_title" value="<?=$fltInfo['title'];?>"></td>
					<td>
						<select class="input-small" name="flt_status">
							<?=Html_Form::makeOptions(_cfg('category.status'),$fltInfo['status'],' '); ?>
						</select>
					</td>
					<td>&nbsp;</td>
				</tr>
				<?php foreach($rows as $r):?>
				<tr id="<?=$r['id'];?>" class="<?=($r['status'] != 'inactive')?'':'warning';?> <?=$r['class']?>">
					<td><input name="uuid[]" value="<?=$r['id'];?>" type="checkbox" ></td>
					<td class="title"><?=$r['title'];?></td>
					<td class="id-status" id="status-<?=$r['id'];?>"><?=($r['status'] == 'active')?"active":"inactive";?></td>
					<td class="ico-td">
						<div class="btn-group">
						  <button type="button" onclick="categoryEdit('<?=$r['id'];?>')" class="btn btn-mini"><i class="icon-pencil"></i></button>
						  <button id="inactive-<?=$r['id'];?>" onclick="categoryDeactivate('<?=$r['id'];?>');" type="button" class="id-inactive btn btn-mini <?=($r['status'] == 'active')?:"btn-warning";?>"><i class="<?=($r['status'] == 'active')?"icon-eye-open":"icon-eye-close";?>"></i></button>
						  <button type="button" class="id-delete btn btn-mini" onclick="categoryDelete('<?=$r['id'];?>');"><i class="icon-trash"></i></button>
						</div>
					</td>
				</tr>
				<?php endforeach;?>
				<?php if(count($rows)==1):?>
				<tr>
					<td colspan="4">
						<?='No results match your search...';?>
					</td>
				</tr>
				<?php endif; ?>
			</table>
		</div>
	</form>
</div>